package de.iritgo.skillfull.component;

import java.awt.Rectangle;

import de.iritgo.skillfull.collision.MoveListener;
import de.iritgo.skillfull.collision.QuadNode;
import de.iritgo.skillfull.entity.Entity;

/**
 * The collision component. Manage the bounds of a collision range.
 * Inform the tree about moving..  
 * 
 * @author held
 */
public interface CollisionComponent extends VisualComponent 
{
	public int getWidth ();
	
	public int getHeight ();
	
	public Rectangle getRectangle ();

	/**
	 * Mark the cc as collided. Only for debugging
	 * 
	 * @param b if true we draw the collsion rectangle
	 */
	public void markCollision (boolean b);
	
	/**
	 * Register this collision component on the collsion manager
	 */
	public void registerOnCollisionManager ();

	/**
	 * Add this cc to an Listener (e.g. a quad node)
	 * 
	 * @param listener The move listener
	 */
	public void addMoveListener (MoveListener listener);

	/**
	 * Remove a cc listener
	 * 
	 * @param listener The move listener
	 */
	public void removeMoveListener (MoveListener listener);

	/**
	 * Inform the cc about a movement
	 */
	public void moved ();
	
	/**
	 * Check if this box touches another
	 * 
	 * @param other The other box to check against  
	 * @return True if the boxes touches
	 */
	public boolean touches (CollisionComponent other);
}
